package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.Option;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface TestSoulMapper extends BaseMapper<Option> {
    //在option表里，根据questionId进行分组，找每一个问题的最高分,
    @Select("select question_id as id ,max(score) as score from tb_option group by question_id")
    List<Map<Integer, Integer>> getMaxScore();

    //在tb_topic_result表里,根据id查找character_type
    @Select("select character_type from tb_topic_result where id = #{id}")
    String findConclusion(Long id);

    //在tb_topic_result表里,根据id查找img
    @Select("select img from tb_topic_result where id = #{id}")
    String findCover(Long id);
}
